﻿using System.Collections.Generic;
using System.Linq;
using DataModel.Models;

namespace DataModel.Managers
{
    public class AuditoryManager
    {
        private readonly UniversityPortalEntities _entityModel;

        public AuditoryManager()
        {
            _entityModel = new UniversityPortalEntities();
        }

        public IEnumerable<AuditoryModel> GetAllAuditories()
        {
            var auditories = _entityModel.Auditories.Select(a => new AuditoryModel
                {
                    ID = a.ID,
                    Housing = a.housing,
                    Number = a.number,
                    Partical = a.partical
                }).AsEnumerable();

            return auditories;
        }
    }
}
